﻿<Window x:Class="Tutorial.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Window1" Height="300" Width="300">
	<Window.Resources>
		<SolidColorBrush x:Key="ListBorder" Color="#828790"/>
		<Style x:Key="SongBrowserStyle" TargetType="{x:Type ListBox}">
			<Style.Resources>
				<Storyboard x:Key="Storyboard1">
					<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="{x:Null}" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)">
						<SplineColorKeyFrame KeyTime="00:00:01" Value="#FFFFA700"/>
					</ColorAnimationUsingKeyFrames>
				</Storyboard>
				<Storyboard x:Key="Storyboard_Copy1">
					<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="{x:Null}" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)">
						<SplineColorKeyFrame KeyTime="00:00:01" Value="#FFFFFFFF"/>
					</ColorAnimationUsingKeyFrames>
				</Storyboard>
			</Style.Resources>
			<Style.Triggers>
				<Trigger Property="IsMouseOver" Value="True">
					<Trigger.ExitActions>
						<BeginStoryboard Storyboard="{StaticResource Storyboard_Copy1}" x:Name="Storyboard_Copy1_BeginStoryboard"/>
					</Trigger.ExitActions>
					<Trigger.EnterActions>
						<BeginStoryboard Storyboard="{StaticResource Storyboard1}"/>
					</Trigger.EnterActions>
				</Trigger>
			</Style.Triggers>
			<Setter Property="Background" Value="#FFFFFFFF"/>
			<Setter Property="BorderBrush" Value="{StaticResource ListBorder}"/>
			<Setter Property="BorderThickness" Value="1"/>
			<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
			<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
			<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
			<Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
			<Setter Property="VerticalContentAlignment" Value="Center"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type ListBox}">
						<Border SnapsToDevicePixels="true" x:Name="Bd" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="1">
							<ScrollViewer Focusable="false" Padding="{TemplateBinding Padding}">
								<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
							</ScrollViewer>
						</Border>
						<ControlTemplate.Triggers>
							<Trigger Property="IsEnabled" Value="false">
								<Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
							</Trigger>
							<Trigger Property="IsGrouping" Value="true">
								<Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
	</Window.Resources>
    <Grid>
        <ListBox HorizontalAlignment="Left" Name="songBrowser" Width="150" Margin="5,5,0,5" Style="{DynamicResource SongBrowserStyle}" />
    </Grid>
</Window>
